package com.atguigu.controller;

import com.atguigu.service.CouponService;
import com.atguigu.service.CouponServiceV2;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: shenhao
 * @CreatTime: 2024/10/26 11:53
 * @Version: 1.0
 */
@RestController
@Slf4j
public class CouponController {
    @Autowired
    private CouponService couponService;
    //http://localhost:8080/coupon/sendv1
    @GetMapping("/coupon/sendv1")
    public String sendCouponV1() {
        couponService.batchTaskAction();
        return "success";
    }

    @Autowired
    //http://localhost:8080/coupon/sendv2
    private CouponServiceV2 couponServiceV2;
    @GetMapping("/coupon/sendv2")
    public String sendCouponV2() {
        couponServiceV2.batchTaskActionV2();
        return "success";
    }
}
